# import logging
# from loguru import logger
#
#
# class PropogateHandler(logging.Handler):
#     def emit(self, record):
#         logging.getLogger(record.name).handle(record)
#
#
# logger.add(PropogateHandler(), format="{time:YYYY-MM-DD at HH:mm:ss} | {message}")
#
#
# class Config(object):
#     def __init__(self, name):
#         self.__name = name
#
#     @property
#     def name(self):
#         return self.__name
#
#
# l = Config("333")
# print(l.name)
# class Person:
#     """hello world"""
#     def __init__(self, name):
#         self.name = name
#         print(self.name)
#
#     def __del__(self):
#         print(self.name + "我去了")
#
#     def method(self):
#         """pass fail"""
#         print("hello world")
#
#     def __str__(self):
#         return "tostring:"+self.name
#
#
# p = Person("tom")
# print(p)
import string

values = {'var': {"name": "123"}}
#1
t1 = string.Template("""
Variable        : $var
Escape          : $$
Variable in text: ${var}iable  急急 急${var}
""")
print('TEMPLATE:', t1.substitute(values))


s1 = """
Variable         {var}
Escape          : {{}}
Variable in text: {var}iable
"""
print('FORMAT:',s1.format(**values))

# class DataSet(object):
#     def __init__(self):
#         self._images = 1
#         self._labels = 2  # 定义属性的名称
#
#     @property
#     def images(self):  # 方法加入@property后，这个方法相当于一个属性，这个属性可以让用户进行使用，而且用户有没办法随意修改。
#         return self._images
#
#     @property
#     def labels(self):
#         return self._labels
#
#
# l = DataSet()
# l.images
